package utils;

public class MessageUtils {

	public static final String SPACE = " ";
	public static final String TRAILING = ":";
	public static final String NULL_CODE = "*";
	public static final String SLASH = "/";

	public static String findWord(String text, int i) {
		String[] words = text.split(SPACE);
		if (words.length > i) {
			return words[i];
		}
		return null;
	}

	public static String findTextFromWordPosition(String text, int i) {
		String[] words = text.split(SPACE);
		StringBuilder builder = new StringBuilder();
		for (int x = i; x < words.length; x++) {
			builder.append(words[x]);
			if (x + 1 < words.length) {
				builder.append(SPACE);
			}
		}
		return builder.toString();
	}

}
